package com.sfx.concurrent.demo.concurrent.Singleton;

/**
 * 懒汉式单例 -> 性能比较低
 */
public class Singleton3 {
    private Singleton3() {
        System.out.println("Singleton3()");
    }
    private static Singleton3 INSTANCE = null;

    public static Singleton3 getInstance() {
        if(INSTANCE ==null) {
            INSTANCE = new Singleton3();
        }
        return INSTANCE;
    }

    public static void otherMethod() {
        System.out.println("otherMethod()");
    }
}